package com.lmc.productservice.controller;

import com.lmc.product.api.ProductInterface;
import com.lmc.product.model.ProductInfo;
import com.lmc.productservice.service.ProductService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/product")
public class ProductController implements ProductInterface {

    @Autowired
    private ProductService productService;

    @RequestMapping("/getProductInfo")
    public ProductInfo getProductInfo(@RequestParam("productId") Long productId) {
        log.info("getProductInfo:{}", productId);
        return productService.getProductInfo(productId);
    }
}
